

import type { Istore } from './entity';
import type { IPageParams } from '@/types/table'
import request from '@/api/request'

export function getPageList(params: IPageParams) {
  return request({
    url: `/admin/express/shipping/templates/list`,
    method: 'get',
    params,
    loading: true
  })
}

export function storeDel(data: any) {
  return request({
    url: `admin/express/shipping/templates/delete`,
    method: 'post',
    data
  })
}
export function storeinfo(id) {
  return request({
    url: `admin/express/shipping/templates/info`,
    params: { id },
    method: 'get'
  })
}
export function storeSelect(id) {
  return request({
    url: `admin/express/shipping/templates/select`,
    method: 'get'
  })
}

export function storeAddup(data: any) {
  return request({
    url: `admin/express/shipping/templates/${!data.id ? 'save' : 'update'}`,
    method: 'post',
    data
  })
}

// 物流运费模板包邮
export function shippingFree(data: any) {
  return request({
    url: '/admin/express/shipping/free/list',
    method: 'get',
    params: { ...data }
  })
}

// 物流运费模板不包邮
export function shippingRegion(data: any) {
  return request({
    url: 'admin/express/shipping/region/list',
    method: 'get',
    params: { ...data }
  })
}

// 城市列表
export function cityListTree() {
  return request({
    url: '/admin/system/city/list/tree',
    method: 'get'
  })
}
